/**
 * @file user_config.h
 * @brief 用户配置头文件
 * 
 * 包含项目的主要配置宏定义和参数声明。
 */

#ifndef USER_CONFIG_H
#define USER_CONFIG_H

// 默认配置值
#ifndef CONFIG_LED_GPIO
#define CONFIG_LED_GPIO 2
#endif

#ifndef CONFIG_DHT11_GPIO
#define CONFIG_DHT11_GPIO 4
#endif

#ifndef CONFIG_DHT11_TASK_STACK_SIZE
#define CONFIG_DHT11_TASK_STACK_SIZE 2048
#endif

#ifndef CONFIG_DHT11_TASK_PRIORITY
#define CONFIG_DHT11_TASK_PRIORITY 5
#endif

#ifndef CONFIG_DHT11_READ_INTERVAL_MS
#define CONFIG_DHT11_READ_INTERVAL_MS 5000
#endif

#ifndef CONFIG_WIFI_SSID
#define CONFIG_WIFI_SSID "your_wifi_ssid"
#endif

#ifndef CONFIG_WIFI_PASSWORD
#define CONFIG_WIFI_PASSWORD "your_wifi_password"
#endif

#ifndef CONFIG_WIFI_MAXIMUM_RETRY
#define CONFIG_WIFI_MAXIMUM_RETRY 5
#endif

#ifndef CONFIG_MQTT_BROKER_URI
#define CONFIG_MQTT_BROKER_URI "mqtt://192.168.1.100:1883"
#endif

#ifndef CONFIG_MQTT_TOPIC_DHT11
#define CONFIG_MQTT_TOPIC_DHT11 "sensor/dht11"
#endif

#ifndef CONFIG_MQTT_TOPIC_LED
#define CONFIG_MQTT_TOPIC_LED "device/led"
#endif

// 芯片特定配置
#if defined(CONFIG_IDF_TARGET_ESP32)
    // ESP32特定配置
    #define LED_GPIO CONFIG_LED_GPIO
    #define DHT11_GPIO CONFIG_DHT11_GPIO
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
    // ESP32-C3特定配置
    #define LED_GPIO CONFIG_LED_GPIO
    #define DHT11_GPIO CONFIG_DHT11_GPIO
#else
    // 默认配置
    #define LED_GPIO 2
    #define DHT11_GPIO 4
#endif

// 功能开关
#ifndef CONFIG_ENABLE_WIFI
#define CONFIG_ENABLE_WIFI 1
#endif

#ifndef CONFIG_ENABLE_MQTT
#define CONFIG_ENABLE_MQTT 1
#endif

#ifndef CONFIG_ENABLE_OTA
#define CONFIG_ENABLE_OTA 0
#endif

#endif // USER_CONFIG_H